//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Input;

namespace OpenLS.UI
{
    partial class VistaOfficeWindowResources
    {
        public VistaOfficeWindowResources()
        {
            InitializeComponent();
        }
        void OnLabelLoaded(object sender, RoutedEventArgs args)
        {
            Label label = (Label)sender;
            Window w = label.TemplatedParent as Window;
            label.Content = w.Title;

        }
        void OnLabelMouseDoubleClick(object sender, MouseButtonEventArgs mouseButtonEventArgs)
        {
            Label label = (Label)sender;
            RibbonWindow w = label.TemplatedParent as RibbonWindow;
            w.ToggleMaximized();

        }
        void OnLabelMouseDown(object sender, MouseButtonEventArgs args)
        {
            //\\return;
            if (args.ButtonState == MouseButtonState.Released)
                return;
            Label label = (Label)sender;
            RibbonWindow w = label.TemplatedParent as RibbonWindow;
            w.DragMove();
        }
        void OnGridLoaded(object sender, RoutedEventArgs e)
        {
            Grid grid = (Grid)sender;
            RibbonWindow w = (RibbonWindow)grid.TemplatedParent;
            System.IntPtr hwnd = (new WindowInteropHelper(w)).Handle;
            HwndSource.FromHwnd(hwnd).CompositionTarget.BackgroundColor = Colors.Transparent;
            w.AdjustMargins();
        }

    }
}
